home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / HyperMail102.lha / HyperMail / libcgi / mcode.c < prev    next >
C/C++ Source or Header  |  1995-06-18  |  682b  |  24 lines

  1. /*
  2.  * This file is part of the LIBCGI library
  3.  *
  4.  * Copyright 1994 by Enterprise Integration Technologies Corporation
  5.  *
  6.  * This is freeware with commercialization rights reserved; see the
  7.  * LICENSE included in the distribution for specifics.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include "cgi.h"
  12.  
  13. int mcode(ci)
  14.      cgi_info *ci;
  15.  {
  16.   if (ci->request_method == NULL) return 0;
  17.   else if (!strncasecmp(ci->request_method, "GET", 3)) return MCODE_GET;
  18.   else if (!strncasecmp(ci->request_method, "POST", 4)) return MCODE_POST;
  19.   else if (!strncasecmp(ci->request_method, "PUT", 3)) return MCODE_PUT;
  20.   else if (!strncasecmp(ci->request_method, "HEAD", 4)) return MCODE_HEAD;
  21.   else return 0;
  22. }
  23.  
  24.